home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
This Disc Bytes!
/
Power Computing - The Disc 2 - This Disc Bytes.ISO
/
pc
/
codewarr
/
macossup
/
headers
/
ansihead
/
unistd.h
< prev
next >
Wrap
Text File
|
1995-08-02
|
3KB
|
132 lines
/*
* File: unistd.h
* ©1993-1995 metrowerks Inc. All rights reserved
* Author: Berardino E. Baratta
*
* Content: Interface file to standard UNIX-style entry points ...
*
* NB: This file implements some UNIX low level support. These functions
* are not guaranteed to be 100% conformant.
*/
#ifndef _UNISTD
#define _UNISTD
#pragma options align=mac68k
#pragma direct_destruction off
#ifndef _STDIO
/* macros for whence parameter of lseek() (taken from <stdio.h> */
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* Change the current directory.
*/
int chdir(const char *path);
/*
* Closes an open file.
*/
int close(int fildes);
/*
* Returns the user name associated with the current process. For the mac we always return
* the login name. If string is not NULL, it must be at least FILENAME_MAX large.
*/
char *cuserid(char *string);
/*
* Launches the application fname and then quits upon succesful launch.
* NB: all exec calls pass through this one call, since argument passing (argc, argv) doesn't
* exist for mac applications.
*/
int exec(const char *path, ...);
#define execl exec
#define execv exec
#define execle exec
#define execle exec
#define execve exec
#define execlp exec
#define execvp exec
/*
* Get the current directory.
*/
char *getcwd(char *buf, int size);
/*
* The following UNIX functions don't really have any meaning on the Mac, so we just
* return values that would make sense for a typical user process under UNIX ...
*/
#define getpid() ((int) 9000)
#define getppid() ((int) 8000)
#define getuid() ((int) 200)
#define geteuid() ((int) 200)
#define getgid() ((int) 100)
#define getegid() ((int) 100)
#define getpgrp() ((int) 9000)
/*
* The Mac doesn't have a login, so we just return the Owner Name from the Sharing Setup
* Control Panel.
*/
char *getlogin(void);
/*
* Determines is a specified fileid is attached to the console.
*/
int isatty(int fildes);
/*
* Seek on a file stream.
*/
long lseek(int fildes, long offset, int whence);
/*
* Reads from a file stream.
*/
int read(int fildes, char *buf, int count);
/*
* Delete a directory.
*/
int rmdir(const char *path);
/*
* Delay program execution for a specified number of seconds.
*/
unsigned int sleep(unsigned int sleep);
/*
* Returns the name of the terminal associated with the fileid, or NULL if fileid doesn't
* specify a terminal.
*/
char *ttyname(int fildes);
/*
* Unlink (delete) a file.
*/
int unlink(const char *path);
/*
* Writes to a file stream.
*/
int write(int fildes, const char *buf, int count);
#ifdef __cplusplus
}
#endif
#pragma options align=reset
#pragma direct_destruction reset
#endif